<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let num = [3, 5, 6, 4, 7, 9, 2, 1, 3, 6]
        for (let i = 0; i < num.length; i++) {
            for (let j = i + 1; j < num.length; j++) {
                if (num[i] === num[j]) {
                    num.splice(j, 1)
                }
            }
        }
        document.write(`${num}<br>`)
        num.sort()
        document.write(`${num}<br>`)
        res = num.slice(-4)
        document.write(`${res}<br>`)
    </script>
</body>

</html>